import matplotlib.pyplot as plt

# 设置中文字体为宋体
plt.rcParams['font.sans-serif'] = ['SimSun']  # 使用宋体
plt.rcParams['axes.unicode_minus'] = False    # 正常显示负号

# 数据
labels = ['系列A', '系列B', '系列C', '系列D']
data_A = [60, 13, 10, 17]
data_B = [49, 24, 16, 11]
data_C = [55, 23, 14, 8]

# 画饼图的函数
def plot_pie_chart(ax, data, title):
    ax.pie(data, labels=labels, autopct='%1.1f%%', startangle=90)
    ax.set_title(title)

# 创建包含1x3子图的图像
fig, axs = plt.subplots(1, 3, figsize=(15, 5))

# 绘制三个饼图
plot_pie_chart(axs[0], data_A, '店铺A')
plot_pie_chart(axs[1], data_B, '店铺B')
plot_pie_chart(axs[2], data_C, '店铺C')

plt.tight_layout()
plt.show()
